package com.action;


import com.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin("*")
public class MailAction {

    @Autowired
    private MailService mailService;

    /**
     * 发送邮件
     *
     * @param mail 接收邮件地址
     * @return
     */

    @RequestMapping("/sendMail")
    public String sendMail(String mail) {
        mailService.sendMail(mail);
        return "succsss";
    }


    @RequestMapping("/checkCode")
    public boolean checkCode(String mail, String code) {
         return mailService.checkCode(mail,code);
    }

}
